//
//  SSNavigationViewController.m
//  SS-FXYX
//
//  Created by paycloud110 on 16/4/22.
//  Copyright © 2016年 paycloud110. All rights reserved.
//

#import "SSNavigationViewController.h"
#import "UIBarButtonItem+Custom.h"

@interface SSNavigationViewController ()

@end

@implementation SSNavigationViewController

+ (void)initialize
{
    UINavigationBar *navBar = [UINavigationBar appearance];
    [navBar setTintColor:[UIColor whiteColor]];
    [navBar setBarTintColor:[UIColor blueColor]];
    [navBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]}];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.interactivePopGestureRecognizer.delegate = nil;
}
- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleDefault;
}
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if (self.childViewControllers.count >= 1) {
        viewController.hidesBottomBarWhenPushed = YES;
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem barButtonItemWithTarget:self andWithAction:@selector(back) andWithImage:@"fx_backicon"];
    }
    [super pushViewController:viewController animated:animated];
}
- (void)back
{
    [self popViewControllerAnimated:YES];
}
@end
